<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- 引入 Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="/ulms_project/js/jquery-3.3.1.min.js"></script>
<title>登录</title>
<style>
/*header的样式*/
.header{
	height:50dp;
	background:#ddd;
	
}
/*容器的样式*/
.container
{
	background:#fff;
	margin-top:30dp;
	height:500px;
}
/*footer的样式*/
div#footer {
    clear: both;
    padding-top: 16px;
    width: 100%;
    line-height: 24px;
    font-family: PingFangSC-Regular, 微软雅黑, Verdana, Arial, 宋体;

    background-color:f9f9f9;
	bottom:20px;
}
</style>
</head>

<body>
<div class="header">
<h1>某高校后勤管理</h1>
</div>
<div class="container">
<form name="loginForm" class="form-horizontal"  style="margin-top:100px"  >
<div class="form-group">
    <label class="col-sm-2 control-label" for="userName"> 账号 </label>
    <div class="col-sm-10">
      <input id="userName" class="form-control" type="text" name="textfield" placeholder="请输入用户名" />
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label" for="password"> 密码 </label>
    <div class="col-sm-10">
      <input id="password" class="form-control" type="password" name="textfield" placeholder="请输入密码" />
    </div>
  </div>
 <div class="form-group">
      <button id="register"  type="button" style="width:400px;margin-left:300px;margin-right:500px" class="btn btn-primary btn-lg btn-block"  name="textfield" value="登录">

  </div>
 <a href="/ulms_project/register.html" style="margin-left:300px">没有账号，注册一个</a>
</form>
<p>&nbsp;</p>
</div>
<div id="footer">
<p id="p1">
某高校后勤管理用于学习
</p>

<p id="p2">
使用条款和隐私条款。版权所有，保留一切权利。
赞助商：<a href="">某公司</a>。

</p>
</div>
</body>
<script type="text/javascript">
$("#register").click(function(){
		submit();
});
function submit()
{
     var name = $("#userName").val();
     var password = $("#password").val();
     $.post("/ulms_project/user1/login",{name:name,password:password},function(data){
          console.log(data);
          var  is_success = data.is_right;
          
          if(is_success ==false)
          {
            //帐号密码错误
            alert("输入帐号密码错误");
          }else
          {
             location.href="/ulms_project/user1/index1";
          }

     });
    
}
</script>

</html>